package com.zhuangfei.ohos_timetableview.language;


import com.zhuangfei.timetable.listener.OnItemBuildAdapter;
import com.zhuangfei.timetable.model.Schedule;

/**
 * 英文的课程文本设置
 */
public class OnEnglishItemBuildAdapter extends OnItemBuildAdapter {
    @Override
    public String getItemText(Schedule schedule, boolean isThisWeek) {
        if (schedule == null || schedule.getName().equals("")) {
            return "Unknow";
        }
        if (schedule.getRoom() == null) {
            if (!isThisWeek) {
                return "[Non]" + schedule.getName();
            }
            return schedule.getName();
        }
        String res = schedule.getName() + "@" + schedule.getRoom();
        if (!isThisWeek) {
            res = "[Non]" + res;
        }
        return res;
    }
}
